package com.yanqu.road.server.cmd.activity.huashigang;

import com.yanqu.road.pb.huashigang.HuaShiGangProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.huashigang.HuaShiGangMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/2/1 17:41
 */
@Cmd(code = GameProtocol.S_HUA_SHI_GANG_UNLOCK_TRANSPORT_FROM_CROSS, desc = "花石纲解锁交通工具返回消息到本服")
public class UnLockTransportFromCrossCmd extends AbstractCommand {
    private int transportId;
    private int ret;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        HuaShiGangProto.UnLockTransportRespToGameServerMsg msg = HuaShiGangProto.UnLockTransportRespToGameServerMsg.parseFrom(packet.getBytes());
        transportId = msg.getTransportId();
        ret = msg.getRet();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        HuaShiGangMgr.UnLockTransport(player, transportId, ret);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
